import { configureStore } from '@reduxjs/toolkit';
import imageSlice from './slices/imageSlice';

export const store = configureStore({
  reducer: {
    image: imageSlice,
  },
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: ['image/setCanvas', 'image/setFabricCanvas'],
        ignoredPaths: ['image.canvas', 'image.fabricCanvas'],
      },
    }),
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;